#pragma once

typedef unsigned __int64 ulong;
typedef unsigned __int32 uint;
typedef unsigned char byte;
typedef signed char sbyte;

// The number of squares in a regulation chess board
#define NUM_SQUARES 64
// The number of different types of pieces { King, Queen, Rook, Knight, Bishop, Pawn }
#define NUM_TYPES 6
// The number of different types of pieces including color
#define NUM_TYPES_WB 12

inline uint bit_condition(uint mask, bool condition)
{
	uint tmpMask = mask >> 1;
	uint cdMask = 1;

	while (tmpMask)
	{
		cdMask <<= 1;
		tmpMask >>= 1;
	}

	return mask & (condition ? cdMask : ~cdMask);
}